<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->

<head>
    <include file="Public:head"/>
    <link rel="stylesheet" href="__PUBLICCOMMON__/plugins/daterangepicker/daterangepicker.css">
</head>

<body>
<section id="container" style="background: #fff">
    <include file="Public:header"/>
    <!--sidebar left start-->
    <include file="Public:siderbar"/>

    <section class="main-content-wrapper">
        <section id="main-content">
            <div class="row panel panel-default">
                <form class="navbar-form navbar-left" role="search" method="get">
                    <div class="form-group">
                        <input type="text" name="nickname" class="form-control" placeholder="昵称">
                        <input type="text" name="date" id="diy-date" class="form-control">
                    </div>
                    <button type="submit" class="btn btn-default">确认</button>
                </form>
                <a href="{:U('User/index')}" class="btn btn-default" style="margin-top: 8px">全部</a>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-body">
                            <div role="grid" id="example_wrapper" class="dataTables_wrapper form-inline no-footer">
                                <table id="example" class="table table-striped table-bordered dataTable no-footer"
                                       cellspacing="0" width="100%" aria-describedby="example_info"
                                       style="width: 100%;">
                                    <thead>
                                    <tr role="row">
                                        <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                                            aria-sort="ascending" aria-label="Name: activate to sort column ascending"
                                            style="width: 275px;">id
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                                            aria-label="Position: activate to sort column ascending"
                                            style="width: 439px;">昵称
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                                            aria-label="Office: activate to sort column ascending"
                                            style="width: 202px;">累计时长(H)
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                                            aria-label="Age: activate to sort column ascending" style="width: 103px;">
                                            累计分享
                                        </th>
                                        <th class="sorting" tabindex="0" aria-controls="example" rowspan="1" colspan="1"
                                            aria-label="Start date: activate to sort column ascending"
                                            style="width: 195px;">首次登录时间
                                        </th>

                                    </tr>
                                    </thead>

                                    <tbody>
                                    <volist name="list" id="vo">
                                        <tr class="odd">
                                            <td class="sorting_1">{$vo.id}</td>
                                            <td>{$vo.nickname}</td>
                                            <td>{$vo.time}</td>
                                            <td>{$vo.share}</td>
                                            <td>{$vo.date}</td>
                                        </tr>
                                    </volist>
                                    </tbody>
                                </table>
                                <div class="row">
                                    <div class="col-xs-6">
                                        <div class="dataTables_paginate paging_simple_numbers" id="example_paginate">

                                            <ul class="pagination">
                                                {$page}
                                            </ul>
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </div>
                </div>
            </div>

        </section>
    </section>
</section>
<!--main content end-->


</section>
<include file="Public:js"/>
<script src="__PUBLICCOMMON__/plugins/daterangepicker/moment.min.js"></script>

<script src="__PUBLICCOMMON__/plugins/daterangepicker/daterangepicker.js"></script>
<script>
    $(function () {

        $('.control-bar button').click(function () {
            $(this).parent('div').find('button').removeClass('current')
            $(this).addClass('current')

        })

        var local_options = {
            format:'YYYY-MM-DD',
            applyLabel: '确认',
            cancelLabel: '取消',
            daysOfWeek: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
            monthNames:'一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_')
        }
        $('#diy-date').daterangepicker({
            locale:local_options
        },function () {

        })

        $('.date').click(function () {
            var id = $(this).data('id');
            if(id === 'diy'){
                id = $('#diy-date').val();
            }
            console.log("{:U('Admin/getData')}?time="+id)
            $.ajax({
                type: "GET",
                url: "{:U('Admin/getData')}?time="+id,
                success: function (result) {
                    result = JSON.parse(result);
                    $('#visite').text(result.visite);
                    $('#old_visite').text(result.old_visite);
                    $('#new_visite').text(result.new_visite);
                    $('#time').text(result.time+'s');
                }
            });
        })
    })

</script>

</body>

</html>
